<!--
Copyright 2017 The Kubernetes Dashboard Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-resource-card object-meta="::$ctrl.daemonSet.objectMeta"
                  type-meta="::$ctrl.daemonSet.typeMeta">
  <kd-resource-card-status layout="row">
    <md-icon class="material-icons kd-error"
             ng-if="::$ctrl.hasWarnings()">
      error
      <md-tooltip md-direction="right">[[One or more pods have errors.|Tooltip for failed pod card icon.]]</md-tooltip>
    </md-icon>
    <md-icon class="material-icons"
             ng-if="::$ctrl.isPending()">
      timelapse
      <md-tooltip md-direction="right">[[One or more pods are in pending state.|Tooltip for pending pod card icon.]]</md-tooltip>
    </md-icon>
    <md-icon class="material-icons kd-success"
             ng-if="::$ctrl.isSuccess()">
      check_circle
    </md-icon>
  </kd-resource-card-status>
  <kd-resource-card-columns>
    <kd-resource-card-column>
      <a ng-href="{{::$ctrl.getDaemonSetDetailHref()}}">
        <kd-middle-ellipsis display-string="{{::$ctrl.daemonSet.objectMeta.name}}">
        </kd-middle-ellipsis>
      </a>
    </kd-resource-card-column>
    <kd-resource-card-column ng-if="::$ctrl.showResourceKind">
      <div>[[Daemon Set|Column 'Daemon Set' in a Daemon Set List]]</div>
    </kd-resource-card-column>
    <kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
      <div>
        <kd-middle-ellipsis display-string="{{::$ctrl.daemonSet.objectMeta.namespace}}">
        </kd-middle-ellipsis>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <kd-labels labels="::$ctrl.daemonSet.objectMeta.labels"></kd-labels>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <span>
        {{::$ctrl.daemonSet.pods.running}} / {{::$ctrl.daemonSet.pods.desired}}
      </span>
    </kd-resource-card-column>
    <kd-resource-card-column>
      {{::$ctrl.daemonSet.objectMeta.creationTimestamp | relativeTime}}
      <md-tooltip>
        {{::$ctrl.getCreatedAtTooltip()}}
      </md-tooltip>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <div ng-repeat="image in ::$ctrl.daemonSet.containerImages track by $index">
        <kd-middle-ellipsis display-string="{{::image}}"></kd-middle-ellipsis>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column class="kd-row-layout-column kd-icon-column">
      <kd-resource-card-menu>
        <kd-resource-card-delete-menu-item resource-kind-name="[[Daemon Set|Title 'Daemon Set' which is used as a title for the delete/update
   dialogs (that can be opened on the daemon set list view).]]">
        </kd-resource-card-delete-menu-item>
        <kd-resource-card-edit-menu-item resource-kind-name="[[Daemon Set|Title 'Daemon Set' which is used as a title for the delete/update
   dialogs (that can be opened on the daemon set list view).]]">
        </kd-resource-card-edit-menu-item>
      </kd-resource-card-menu>
    </kd-resource-card-column>
  </kd-resource-card-columns>
</kd-resource-card>
